// api/auth/sysfun/doGetFunctionList
import axios from './request';
// 查询所有
function getMenuList(){
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/auth/sysfun/doGetLayerFunctionObject",{}).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });

    })
    
}

//查询所有机构
function getMenuList1(){
    return new Promise((resolve, reject)=>{
        axios.formPost("/api/auth/sysorgan/doGetLayerOrgan",{}).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });

    })
    
}

// 根据角色Id
function getFunctionListByRoleId(params){
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/auth/sysfun/doGetLayerFunctionListByRoleId",params).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });

    })
}
// 根据用户Id
function getFunctionListByUserId(params){
    return new Promise((resolve, reject)=>{
        // axios.formPost( "/api/auth/sysfun/doGetLayerFunctionListByUserId",params).then(res=>{
            axios.formPost( "/api/auth/sysfun/doGetLayerFunctionListByUserId",params).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
        

    })
}
export {
    getMenuList1,
    getMenuList,
    getFunctionListByRoleId,
    getFunctionListByUserId
}